package org.madgecko.basic.model;

import org.madgecko.basic.model.anno.Excel;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "t_student", uniqueConstraints = {@UniqueConstraint(columnNames = {"stu_num"})})
public class Student {

	private int id;
	@Excel(exportName="姓名",exportFieldWidth=20,exportConvertSign=0,importConvertSign=0)
	private String name;
	@Excel(exportName="学号",exportFieldWidth=20,exportConvertSign=0,importConvertSign=0)
	private String stuNum;
	private String password;
	private Clazz clazz;
	private String clazzName;
	private int status;
	private Date createDate;
	private String des;

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "stu_num")
	public String getStuNum() {
		return stuNum;
	}

	public void setStuNum(String stuNum) {
		this.stuNum = stuNum;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@ManyToOne
	@JoinColumn(name = "clazz_id")
	public Clazz getClazz() {
		return clazz;
	}

	public void setClazz(Clazz clazz) {
		this.clazz = clazz;
	}

	@Column(name = "clazz_name")
	public String getClazzName() {
		return clazzName;
	}

	public void setClazzName(String clazzName) {
		this.clazzName = clazzName;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Column(name = "create_date")
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getDes() {
		return des;
	}

	public void setDes(String des) {
		this.des = des;
	}

	public Student() {
	}
}
